package cn.funnyxb.powerremember.uis.task.done;

import android.content.Intent;
import cn.funnyxb.powerremember.beans.ATask;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;

public class InputIntentChecker
{
  private int groupEnd;
  private int groupId = 1;
  private int groupStart;
  private Intent intent;
  private int rangeType = -2;
  private int studyTpye = 10;
  private ATask taskInfo;
  private int wordEnd;
  private int wordStart;

  public InputIntentChecker(Intent paramIntent)
  {
    this.intent = paramIntent;
  }

  private boolean checkRangeType()
  {
    this.rangeType = this.intent.getIntExtra("rangetype", -1);
    log("rangeType=" + this.rangeType);
    if ((this.rangeType == 1) || (this.rangeType == 2) || (this.rangeType == 3))
      log("rangtype ok");
    for (int i = 1; ; i = 0)
    {
      log("rangtype err");
      return i;
    }
  }

  private boolean checkStudyType()
  {
    this.studyTpye = this.intent.getIntExtra("studytype", -1);
    if (this.studyTpye < 0);
    for (int i = 0; ; i = 1)
      return i;
  }

  private boolean checkTaskInfo()
  {
    int i;
    try
    {
      this.taskInfo = ((ATask)this.intent.getSerializableExtra("atask"));
      log("taskInfo=" + this.taskInfo);
      if (this.taskInfo != null)
        break label56;
      i = 0;
      label48: label56: return i;
    }
    catch (Exception localException)
    {
      i = 0;
      break label48:
      i = 1;
    }
  }

  private boolean checkWordStartAndEnd(int paramInt1, int paramInt2)
  {
    log("wordstart=" + paramInt1 + ",end=" + paramInt2);
    if ((paramInt1 < 0) || (paramInt2 < 0) || (paramInt1 > paramInt2) || (paramInt1 > this.taskInfo.getWordCnt()));
    for (int i = 0; ; i = 1)
      return i;
  }

  private boolean computeWordRange()
  {
    log("compute");
    if (this.rangeType == 3)
    {
      this.wordStart = this.intent.getIntExtra("wordstart", -1);
      this.wordEnd = this.intent.getIntExtra("wordend", -1);
    }
    for (boolean bool = checkWordStartAndEnd(this.wordStart, this.wordEnd); ; bool = false)
      while (true)
      {
        return bool;
        if (this.rangeType == 1)
        {
          this.groupId = this.intent.getIntExtra("groupid", -2);
          this.wordStart = (1 + (this.groupId - 1) * this.taskInfo.getGroupSize());
          this.wordEnd = (this.wordStart + this.taskInfo.getGroupSize() - 1);
          bool = checkWordStartAndEnd(this.wordStart, this.wordEnd);
        }
        if (this.rangeType != 2)
          break;
        this.groupStart = this.intent.getIntExtra("groupstart", -2);
        this.groupEnd = this.intent.getIntExtra("groupend", -3);
        this.wordStart = (1 + (this.groupStart - 1) * this.taskInfo.getGroupSize());
        this.wordEnd = (1 + (this.groupEnd - 1) * this.taskInfo.getGroupSize());
        bool = checkWordStartAndEnd(this.wordStart, this.wordEnd);
      }
  }

  private void log(String paramString)
  {
    Debuger.log("inputintentcheck", paramString);
  }

  public boolean checkInputIsValid()
  {
    if ((checkStudyType()) && (checkTaskInfo()) && (checkRangeType()) && (computeWordRange()));
    for (int i = 1; ; i = 0)
      return i;
  }

  public int getGroupEnd()
  {
    return this.groupEnd;
  }

  public int getGroupId()
  {
    return this.groupId;
  }

  public int getGroupStart()
  {
    return this.groupStart;
  }

  public Intent getIntent()
  {
    return this.intent;
  }

  public int getRangeType()
  {
    return this.rangeType;
  }

  public int getStudyTpye()
  {
    return this.studyTpye;
  }

  public ATask getTaskInfo()
  {
    return this.taskInfo;
  }

  public int getWordEnd()
  {
    return this.wordEnd;
  }

  public int getWordStart()
  {
    return this.wordStart;
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.uis.task.done.InputIntentChecker
 * JD-Core Version:    0.5.3
 */